package com.moyq5.permit.center.web.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.moyq5.mvc.framework.general.Body;
import com.moyq5.mvc.framework.general.PageData;
import com.moyq5.permit.center.bean.search.Shop4Search;
import com.moyq5.permit.center.feign.client.ShopFeign;
import com.moyq5.permit.center.web.jackson.filter.ShopFilter;


/**
 * 门店
 * @author Moyq5
 * @date 2019年7月31日
 */
@RestController
@RequestMapping("/shop")
public class ShopController extends BaseController {
	
	private static Logger log = LoggerFactory.getLogger(ShopController.class);
	
	@Autowired
	private ShopFeign shopFeign;
	
	/**
	 * @author Moyq5
	 * @date 2019年7月31日
	 * @param shop4s
	 * @param pd
	 * @return
	 * @throws JsonProcessingException
	 */
	@GetMapping(value="/page", produces={MediaType.APPLICATION_JSON_UTF8_VALUE})
	@ResponseBody
	public String page(Shop4Search shop4s, PageData pd) throws JsonProcessingException {
		log.debug("查询门店信息>>>page(Shop4Search, PageData)");
		return toJson(shopFeign.page(new Body<Shop4Search, PageData>(shop4s, pd)), ShopFilter.get());
	}
	
}
